/***************************************************
 @Name :        小铭同学
 @Time :        2025-09-03
 @Email :       LiaoMingWJ233@163.com
 @Comment :     LED灯 设备驱动控制
 @FileName :    leddevice.cpp
 @Version :     1.0
****************************************************/


#include "leddevice.h"
using namespace std;

ledDevice::ledDevice(QWidget *parent) : QWidget(parent)
{
    led_init();
}

int ledDevice::led_On(int nr)
{
    int ret = 0;
    ret = led_on(nr);
    if(ret<0)
    {
        perror("open led failed\n");
    }        
    return ret;
}

int ledDevice::led_Off(int nr)
{
    int ret = 0;
    ret = led_off(nr);
    if(ret<0)
    {
        perror("open led failed\n");
    }
    return ret;
}

int ledDevice::led_all_On()
{
    int ret = 0;
    ret = led_all_on();
    if(ret<0)
    {
        perror("open led failed\n");
    }
    return ret;
}

int ledDevice::led_all_Off()
{
    int ret = 0;
    ret = led_all_off();
    if(ret<0)
    {
        perror("open led failed\n");
    }
    return ret;
}
